package com.hsd.znsh.repository;

import com.hsd.znsh.entity.SensorGroup;
import com.hsd.znsh.entity.UserSensorGroup;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/*
 * @auther: wangjiacai
 *
 * @create: 2018-04-23 11:54:50
 */
public interface UserSensorGroupRepository extends JpaRepository<UserSensorGroup,Integer> {

    @Query("select sensorGroupId from UserSensorGroup where userId=?1")
    List<Integer> findSensorGroupIdListByUserId(Integer userId);

    void deleteByUserId(Integer userId);

    void deleteBySensorGroupId(Integer sensorGroupId);
}
